package com.yjz.middleware.elastic_job;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;

/**
 * @author :yuanJinZhong
 * @description:elastic job 学习
 * @date :2018/7/6-9:04
 */
public class MyElasticJob implements SimpleJob {
  @Override
  public void execute(ShardingContext context) {
    System.out.println(String.format("------Thread ID: %s, 任务总片数: %s, 当前分片项: %s",
      Thread.currentThread().getId(), context.getShardingTotalCount(), context.getShardingItem()));
  }
}
